import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class C_1627 {
    static int max;
    static List<Integer> re;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        while(sc.hasNextInt()) {
            list.add(sc.nextInt());
        }
        int shot = list.size();
        dfs(list,new ArrayList<>(),-1,0);
        int t = max;
        int re1 = max;
        int num = 1;
        if (max!=list.size())
        while (t!=shot){
            List<Integer> temp = new ArrayList<>();
            for (int i = 0;i<list.size();i++){
                if (!re.contains(i)){
                    temp.add(list.get(i));
                }
            }
            max = 0;
            re = new ArrayList<>();
            dfs(temp,new ArrayList<>(),-1,0);
            t+=re.size();
            list = temp;
            num++;
        }
        System.out.println(re1);
        System.out.println(num);
    }
    static void dfs(List<Integer> list,List<Integer> now,int height,int at) {
        if (max<now.size()){
            max = now.size();
            re = new ArrayList<>(now);
        }
        for(int i = at;i<list.size();i++) {
            if(at==0)
                height = list.get(i);
            if(list.get(i)<=height) {
                now.add(i);
                dfs(list,now,list.get(i),i+1);
                now.remove(now.size()-1);
            }
        }
    }
}
